<?php

namespace App\Observers;

use App\Models\Apiuser;

class UserObserver
{
    // 添加动作之前
    public function creating(Apiuser $apiuser)
    {
        $apiuser->password = bcrypt(request()->get('password'));
    }

    /**
     * Handle the apiuser "created" event.
     *
     * @param  \App\Models\Apiuser  $apiuser
     * @return void
     */
    public function created(Apiuser $apiuser)
    {
        //
    }

    /**
     * Handle the apiuser "updated" event.
     *
     * @param  \App\Models\Apiuser  $apiuser
     * @return void
     */
    public function updated(Apiuser $apiuser)
    {
        //
    }

    /**
     * Handle the apiuser "deleted" event.
     *
     * @param  \App\Models\Apiuser  $apiuser
     * @return void
     */
    public function deleted(Apiuser $apiuser)
    {
        //
    }

    /**
     * Handle the apiuser "restored" event.
     *
     * @param  \App\Models\Apiuser  $apiuser
     * @return void
     */
    public function restored(Apiuser $apiuser)
    {
        //
    }

    /**
     * Handle the apiuser "force deleted" event.
     *
     * @param  \App\Models\Apiuser  $apiuser
     * @return void
     */
    public function forceDeleted(Apiuser $apiuser)
    {
        //
    }
}
